fix: use rm -f to handle missing .py files in llamacpp install#932
Merged
Conversation
llama.cpp no longer ships Python scripts in install/bin/, so the glob expands to nothing and bare rm exits non-zero, failing the macOS e2e build. Using rm -f silently succeeds when no files match.
doringeman
approved these changes
May 21, 2026
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the llamacpp/Makefile to use the -f flag with the rm command when cleaning up Python scripts in the installation directory. A review comment suggests quoting the installation directory path to ensure the command handles directory names with spaces correctly, improving the robustness of the build process.
| --prefix $(INSTALL_DIR) | ||
| @echo "Cleaning install directory..." | ||
| rm $(INSTALL_DIR)/bin/*.py | ||
| rm -f $(INSTALL_DIR)/bin/*.py |
Contributor
There was a problem hiding this comment.
The path should be quoted to handle cases where $(INSTALL_DIR) contains spaces. Unquoted paths in shell commands can lead to incorrect file deletion or command failure if the directory name contains whitespace. This aligns with the repository's focus on correctness and safety (Repository Style Guide, line 24).
rm -f "$(INSTALL_DIR)/bin/"*.py
References
- The repository style guide prioritizes correctness and safety. Unquoted paths in shell commands are a common source of bugs and safety issues when directory names contain spaces. (link)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rm install/bin/*.pyexits non-zero when no.pyfiles existinstall/bin/, so the glob expands to nothing and barermfailsrmtorm -fso the cleanup step silently succeeds when no files matchRoot cause
rm -fis the idiomatic fix — it ignores nonexistent files without changing behavior when files do exist.